

import Vue from "vue"
import VueRouter from "vue-router"
Vue.use(VueRouter)

import errorRoute from "@/views/errorpage/route"
import mainRoute from "@/views/main/route"
import loginsRoute from "@/views/logins/route"
import goodRoute from "@/views/good/route"

const routes = [
  {
    path:"/",
    redirect:"/guide"
  },
  {
    path:"/guide",
    name:'guide',
    component:()=>import("@/views/guide/guide.vue")
  },
  {
    path:"/search",
    name:'search',
    component:()=>import("@/views/search/search.vue")
  },
  {
    path:"/city",
    name:'city',
    component:()=>import("@/views/city/city.vue")
  },
  {
    path:"/film/:filmId",
    name:'film',
    component:()=>import("@/views/movie/film.vue")
  },
  {
    path:"/buy/:filmId",
    name:'buy',
    component:()=>import("@/views/movie/buy.vue")
  },
  {
    path:"/cinema/:cinemaId/film/:filmId?/:date?",
    name:'cinema-detail',
    component:()=>import("@/views/cinema/detail.vue")
  },
  {
    path:"/good-detail/:goodId",
    name:'good-detail',
    component:()=>import("@/views/good/gitem.vue")
  },
  ...goodRoute,
  ...errorRoute,
  ...mainRoute,
  ...loginsRoute,
  {
    path:"*",
    redirect:"/404"
  }
]


const router = new VueRouter({
    routes,
    mode:"hash"
})

export default router;